/** * @license * Copyright (c) 2014, 2018, Oracle and/or its affiliates. * The Universal Permissive License (UPL), Version 1.0 */ "use strict";define(["ojs/ojcore","jquery","ojL10n!ojtranslations/nls/localeElements","ojs/ojvalidation-base"],function(e,t,r){var a,n;e.DateTimeConverter=function(e){this.Init(e)},e.Object.createSubclass(e.DateTimeConverter,e.Converter,"oj.DateTimeConverter"),e.DateTimeConverter.prototype.Init=function(t){e.DateTimeConverter.superclass.Init.call(this,t)},e.DateTimeConverter.prototype.format=function(t){return e.DateTimeConverter.superclass.format.call(this,t)},e.DateTimeConverter.prototype.isHourInDaySet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.isHourInAMPMSet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.isMinuteSet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.isSecondSet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.isMilliSecondSet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.isYearSet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.isMonthSet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.isDaySet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.isDayNameSet=function(){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.calculateWeek=function(t){e.Assert.failedInAbstractFunction()},e.DateTimeConverter.prototype.parse=function(t){return e.DateTimeConverter.superclass.parse.call(this,t)},e.DateTimeConverter.prototype.compareISODates=function(t,r){return e.DateTimeConverter.superclass.compareISODates.call(this,t,r)},e.DateTimeConverter.prototype.getAvailableTimeZones=function(){return e.DateTimeConverter.superclass.getAvailableTimeZones.call(this)},e.DateRestrictionValidator=function(e){this.Init(e)},e.Object.createSubclass(e.DateRestrictionValidator,e.Validator,"oj.DateRestrictionValidator"),e.DateRestrictionValidator.prototype.Init=function(t){e.DateRestrictionValidator.superclass.Init.call(this),this._dayFormatter=t.dayFormatter,this._converter=e.IntlConverterUtils.getConverterInstance(t.converter),t&&(this._messageSummary=t.messageSummary||null,this._messageDetail=t.messageDetail||null)},e.DateRestrictionValidator.prototype._inDisabled=function(e){var t=this._dayFormatter;if(t){var r=t({fullYear:e.fullYear,month:e.month+1,date:e.date});return r&&r.disabled}return!1},e.DateRestrictionValidator.prototype.validate=function(t){var r="",a="",n=e.Translations,i=this._messageSummary,o=this._messageDetail,s=t?this._converter.format(t):t,l=t?e.IntlConverterUtils._dateTime(t,["fullYear","month","date"],!0):null;if(null===t)return t;if(this._inDisabled(l))throw r=i?n.applyParameters(i,{value:s}):n.getTranslatedString("oj-validator.restriction.date.messageSummary",{value:s}),a=o?n.applyParameters(o,{value:s}):n.getTranslatedString("oj-validator.restriction.date.messageDetail",{value:s}),new e.ValidatorError(r,a);return t},e.DateRestrictionValidator.prototype.getHint=function(){return null},e.DateTimeRangeValidator=function(e){this.Init(e)},e.Object.createSubclass(e.DateTimeRangeValidator,e.Validator,"oj.DateTimeRangeValidator"),e.DateTimeRangeValidator.prototype.Init=function(t){if(e.DateTimeRangeValidator.superclass.Init.call(this),this._converter=e.IntlConverterUtils.getConverterInstance(t.converter),!this._converter)throw new Error("oj.DateTimeRangeValidator missing a converter option");this._min=t.min||null,this._max=t.max||null,this._translationKey=t.translationKey||"datetime",t&&(this._hint=t.hint||{},this._customMessageSummary=t.messageSummary||{},this._customMessageDetail=t.messageDetail||{}),this._translationKey&&(e.Translations.getTranslatedString("oj-validator.range."+this._translationKey+".messageSummary.rangeOverflow")||(this._translationKey="datetime"))},e.DateTimeRangeValidator.prototype.validate=function(t){var r,a,n=this._customMessageSummary,i=this._customMessageDetail,o=i.rangeOverflow,s=i.rangeUnderflow,l=n.rangeOverflow,d=n.rangeUnderflow,u=e.IntlConverterUtils,m=this._min,c=this._max,v="",g="",f=e.Translations,p=null,h=t&&this._converter.format(t);if(null===t)return t;if(h=this._converter.format(t),m&&(m=u._minMaxIsoString(m,t),r=this._converter?this._converter.format(m):m),c&&(c=u._minMaxIsoString(c,t),a=this._converter?this._converter.format(c):c),null!==m&&null!==c){if(this._converter.compareISODates(t,m)>=0&&this._converter.compareISODates(t,c)<=0||this._converter.compareISODates(m,c)>0)return t}else if(null!==m){if(this._converter.compareISODates(t,m)>=0)return t}else if(null===c||this._converter.compareISODates(t,c)<=0)return t;throw null!==c&&this._converter.compareISODates(t,c)>0?(p={value:h,max:a},v=l||f.getTranslatedString("oj-validator.range."+this._translationKey+".messageSummary.rangeOverflow"),g=o?f.applyParameters(o,p):f.getTranslatedString("oj-validator.range."+this._translationKey+".messageDetail.rangeOverflow",p)):null!==m&&this._converter.compareISODates(t,m)<0&&(p={value:h,min:r},v=d||f.getTranslatedString("oj-validator.range."+this._translationKey+".messageSummary.rangeUnderflow"),g=s?f.applyParameters(s,p):f.getTranslatedString("oj-validator.range."+this._translationKey+".messageDetail.rangeUnderflow",p)),new e.ValidatorError(v,g)},e.DateTimeRangeValidator.prototype.getHint=function(){var t=null,r=this._hint,a=r.inRange,n=r.min,i=r.max,o=this._min,s=this._max,l=o&&this._converter?this._converter.format(o):o,d=s&&this._converter?this._converter.format(s):s,u=null,m=e.Translations;return null!==o&&null!==s?(u={min:l,max:d},t=a?m.applyParameters(a,u):m.getTranslatedString("oj-validator.range."+this._translationKey+".hint.inRange",u)):null!==o?(u={min:l},t=n?m.applyParameters(n,u):m.getTranslatedString("oj-validator.range."+this._translationKey+".hint.min",u)):null!==s&&(u={max:d},t=i?m.applyParameters(i,u):m.getTranslatedString("oj-validator.range."+this._translationKey+".hint.max",u)),t},e.DateTimeConverterFactory=function(){return{createConverter:function(t){return function(t){return new e.IntlDateTimeConverter(t)}(t)}}}(),e.Validation.__registerDefaultConverterFactory(e.ConverterFactory.CONVERTER_TYPE_DATETIME,e.DateTimeConverterFactory),e.DateTimeRangeValidatorFactory=function(){return{createValidator:function(t){return function(t){return new e.DateTimeRangeValidator(t)}(t)}}}(),e.Validation.__registerDefaultValidatorFactory(e.ValidatorFactory.VALIDATOR_TYPE_DATETIMERANGE,e.DateTimeRangeValidatorFactory),e.DateRestrictionValidatorFactory=function(){return{createValidator:function(t){return function(t){return new e.DateRestrictionValidator(t)}(t)}}}(),e.Validation.__registerDefaultValidatorFactory(e.ValidatorFactory.VALIDATOR_TYPE_DATERESTRICTION,e.DateRestrictionValidatorFactory),e.IntlDateTimeConverter=function(e){this.Init(e)},e.Object.createSubclass(e.IntlDateTimeConverter,e.DateTimeConverter,"oj.IntlDateTimeConverter"),e.IntlDateTimeConverter._DEFAULT_DATE=new Date(1998,10,29,15,45,31),e.IntlDateTimeConverter.prototype.Init=function(t){e.IntlDateTimeConverter.superclass.Init.call(this,t)},e.IntlDateTimeConverter.prototype._getWrapped=function(){return this._wrapped||(this._wrapped=a.getInstance()),this._wrapped},e.IntlDateTimeConverter.prototype.format=function(t){var r=e.LocaleData.__getBundle(),a=e.Config.getLocale(),n=this.resolvedOptions();if(null==t||"string"==typeof t&&0===e.StringUtils.trim(""+t).length)return e.IntlConverterUtils.__getNullFormattedValue();try{return this._getWrapped().format(t,r,n,a)}catch(e){throw this._processConverterError(e,t)}},e.IntlDateTimeConverter.prototype.formatRelative=function(t,r){var a=e.LocaleData.__getBundle(),n=e.Config.getLocale();try{return this._getWrapped().formatRelative(t,a,r,n)}catch(e){throw this._processConverterError(e,t)}},e.IntlDateTimeConverter.prototype.getHint=function(){return null},e.IntlDateTimeConverter.prototype._getHintValue=function(){var t="";try{t=this.format(e.IntlConverterUtils.dateToLocalIso(e.IntlDateTimeConverter._DEFAULT_DATE))}catch(r){r instanceof e.ConverterError&&(t="")}finally{return t}},e.IntlDateTimeConverter.prototype.getOptions=function(){return e.IntlDateTimeConverter.superclass.getOptions.call(this)},e.IntlDateTimeConverter.prototype.resolvedOptions=function(){var t,r=e.Config.getLocale(),a=this.getOptions();if(r!==this._locale||!this._resolvedOptions){t=e.LocaleData.__getBundle();try{if(!t)return e.Logger.error("locale bundle for the current locale %s is unavailable",r),{};this._resolvedOptions=this._getWrapped().resolvedOptions(t,a,r),this._locale=r}catch(e){throw this._processConverterError(e)}}return this._resolvedOptions},e.IntlDateTimeConverter.prototype.isHourInDaySet=function(){var e=this.resolvedOptions(),t=e.hour,r=e.hour12;return!(!t||r)},e.IntlDateTimeConverter.prototype.isHourInAMPMSet=function(){var e=this.resolvedOptions(),t=e.hour,r=e.hour12;return!(!t||!r)},e.IntlDateTimeConverter.prototype.isMinuteSet=function(){return this._isOptionSet("minute")},e.IntlDateTimeConverter.prototype.isSecondSet=function(){return this._isOptionSet("second")},e.IntlDateTimeConverter.prototype.isMilliSecondSet=function(){return this._isOptionSet("millisecond")},e.IntlDateTimeConverter.prototype.isYearSet=function(){return this._isOptionSet("year")},e.IntlDateTimeConverter.prototype.isMonthSet=function(){return this._isOptionSet("month")},e.IntlDateTimeConverter.prototype.isDaySet=function(){return this._isOptionSet("day")},e.IntlDateTimeConverter.prototype.isDayNameSet=function(){return this._isOptionSet("weekday")},e.IntlDateTimeConverter.prototype.calculateWeek=function(t){return this._getWrapped().calculateWeek(t,e.LocaleData.__getBundle(),e.Config.getLocale())},e.IntlDateTimeConverter.prototype.parse=function(t){var r,a;if(null==t||""===t)return null;var n=e.LocaleData.__getBundle(),i=e.Config.getLocale(),o=this.resolvedOptions();try{return(a=(r=this._getWrapped().parse(t,n,o,i)).value)&&r.warning&&e.Logger.warn("The value "+t+" was leniently parsed to represent a date "+a.toString?a.toString():a),a}catch(e){throw this._processConverterError(e,t)}},e.IntlDateTimeConverter.prototype.compareISODates=function(t,r){var a=e.StringUtils.isString;if(!a(t)||!a(r))throw new Error("Invalid arguments for compareISODates ",t,r);return this._getWrapped().compareISODates(t,r,e.LocaleData.__getBundle())},e.IntlDateTimeConverter.prototype._processConverterError=function(t,r){var a,n,i,o,s,l,d,u=t.errorInfo;return u&&(i=u.errorCode,o=u.parameterMap||{},e.Assert.assertObject(o),l=o.propertyName,l=e.Translations.getTranslatedString("oj-converter.datetime.datetimeOutOfRange."+l),o.propertyName=l,t instanceof TypeError?"optionTypesMismatch"!==i&&"optionTypeInvalid"!==i||(s=e.IntlConverterUtils.__getConverterOptionError(i,o)):t instanceof RangeError?"optionOutOfRange"===i?s=e.IntlConverterUtils.__getConverterOptionError(i,o):"datetimeOutOfRange"===i&&(a=e.Translations.getTranslatedString("oj-converter.datetime.datetimeOutOfRange.summary",{propertyName:l,value:o.value}),n=e.Translations.getTranslatedString("oj-converter.datetime.datetimeOutOfRange.detail",{minValue:o.minValue,maxValue:o.maxValue}),s=new e.ConverterError(a,n)):t instanceof SyntaxError?"optionValueInvalid"===i&&(s=e.IntlConverterUtils.__getConverterOptionError(i,o)):t instanceof Error&&("dateFormatMismatch"===i?d="oj-converter.datetime.dateFormatMismatch.summary":"timeFormatMismatch"===i?d="oj-converter.datetime.timeFormatMismatch.summary":"datetimeFormatMismatch"===i?d="oj-converter.datetime.datetimeFormatMismatch.summary":"invalidTimeZoneID"===i?(a=e.Translations.getTranslatedString("oj-converter.datetime.invalidTimeZoneID.summary",{timeZoneID:o.timeZoneID}),n=e.Translations.getTranslatedString("oj-converter.hint.detail",{exampleValue:this._getHintValue()}),s=new e.ConverterError(a,n)):"nonExistingTime"===i?d="oj-converter.datetime.nonExistingTime.summary":"missingTimeZoneData"===i?d="oj-converter.datetime.missingTimeZoneData.summary":"dateToWeekdayMismatch"===i?(a=e.Translations.getTranslatedString("oj-converter.datetime.dateToWeekdayMismatch.summary",{date:o.date,weekday:o.weekday}),n=e.Translations.getTranslatedString("oj-converter.datetime.dateToWeekdayMismatch.detail"),s=new e.ConverterError(a,n)):"invalidISOString"===i&&(a=e.Translations.getTranslatedString("oj-converter.datetime.invalidISOString.summary",{isoStr:o.isoStr}),n=e.Translations.getTranslatedString("oj-converter.datetime.invalidISOString.detail"),s=new e.ConverterError(a,n)),d&&(a=e.Translations.getTranslatedString(d,{value:r||o.value,format:o.format}),n=e.Translations.getTranslatedString("oj-converter.hint.detail",{exampleValue:this._getHintValue()}),s=new e.ConverterError(a,n)))),s||(a=t.message,n=t.message,s=new e.ConverterError(a,n)),s},e.IntlDateTimeConverter.prototype._isOptionSet=function(e){return!!this.resolvedOptions()[e]},e.IntlDateTimeConverter.prototype.getAvailableTimeZones=function(){return this._getWrapped().getAvailableTimeZones(e.LocaleData.__getBundle())},e.IntlDateTimeConverter.prototype._getTimePositioning=function(){return this._getWrapped().getTimePositioning(e.LocaleData.__getBundle(),this.resolvedOptions(),e.Config.getLocale())},a=function(){var t,r,i,o,s,l,d,u,m,c,v,g,f,p,h,y,I,O,T,k,D,M,E,b,U,w,x,S,C,_,L,Z,F,N,z,P,G,V,A,j,R,H,K,W,X,Y,$,B,q,J,Q,ee,te,re,ae,ne,ie,oe,se,le,de,ue,me,ce,ve,ge,fe,pe,he,ye,Ie,Oe,Te,ke,De,Me,Ee,be,Ue,we,xe,Se,Ce,_e={},Le={},Ze=/(\d{1,4})\D+?(\d{1,4})/g,Fe=/(\d{1,4})\D+?(\d{1,4})\D+?(\d{1,4})/g,Ne=/^[M][^M]|[^M]M[^M]|[^M]M$|^M$/g,ze=/^[L][^L]|[^L]L[^L]|[^L]L$|^L$/g,Pe=/^[d][^d]|[^d]d[^d]|[^d]d$|^d$|^d[^d]/,Ge=/(?:^|[^h])h[^h]|[^H]H[^H]|[^k]k[^k]|[^K]K[^K]|^H[^H]|^H$|[^h]h$/,Ve=/'.*'/,Ae=/'[^d]*d[^d]*'/,je=/(\d{1,2})(?:\D+?(\d{1,2}))?(?:\D+?(\d{1,2}))?(?:\D+?(\d{1,3}))?/g,Re=/h|H|K|k/g,He=/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,Ke=/ccccc|cccc|ccc|cc|c|EEEEE|EEEE|EEE|EE|E|dd|d|MMMMM|MMMM|MMM|MM|M|LLLLL|LLLL|LLL|LL|L|yyyy|yy|y|hh|h|HH|H|KK|K|kk|k|mm|m|ss|s|aa|a|SSS|SS|S|zzzz|zzz|zz|z|v|ZZZ|ZZ|Z|XXX|XX|X|VV|GGGGG|GGGG|GGG|GG|G/g,We={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},Xe=46,Ye=46,$e=23,Be=7,qe=4,Je=12,Qe="zulu",et="local",tt="offset",rt="UTC",at="(\\D+|\\d\\d?\\D|\\d\\d?|\\D+\\d\\d?)",nt="(\\D+|\\D+\\d\\d?)",it={MMM:{token:"months",style:"format",mLen:"abbreviated",matchIndex:0,key:"month",value:"short",regExp:at},MMMM:{token:"months",style:"format",mLen:"wide",matchIndex:0,key:"month",value:"long",regExp:at},MMMMM:{token:"months",style:"format",mLen:"narrow",matchIndex:0,key:"month",value:"narrow",regExp:at},LLL:{token:"months",style:"stand-alone",mLen:"abbreviated",matchIndex:1,key:"month",value:"short",regExp:at},LLLL:{token:"months",style:"stand-alone",mLen:"wide",matchIndex:1,key:"month",value:"long",regExp:at},LLLLL:{token:"months",style:"stand-alone",mLen:"narrow",matchIndex:1,key:"month",value:"narrow",regExp:at},E:{token:"days",style:"format",dLen:"abbreviated",matchIndex:0,key:"weekday",value:"short",regExp:nt},EE:{token:"days",style:"format",dLen:"abbreviated",matchIndex:0,key:"weekday",value:"short",regExp:nt},EEE:{token:"days",style:"format",dLen:"abbreviated",matchIndex:0,key:"weekday",value:"short",regExp:nt},EEEE:{token:"days",style:"format",dLen:"wide",matchIndex:0,key:"weekday",value:"long",regExp:nt},EEEEE:{token:"days",style:"format",dLen:"narrow",matchIndex:0,key:"weekday",value:"narrow",regExp:nt},c:{token:"days",style:"stand-alone",dLen:"abbreviated",matchIndex:1,key:"weekday",value:"short",regExp:nt},cc:{token:"days",style:"stand-alone",dLen:"abbreviated",matchIndex:1,key:"weekday",value:"short",regExp:nt},ccc:{token:"days",style:"stand-alone",dLen:"abbreviated",matchIndex:1,key:"weekday",value:"short",regExp:nt},cccc:{token:"days",style:"stand-alone",dLen:"wide",matchIndex:1,key:"weekday",value:"long",regExp:nt},ccccc:{token:"days",style:"stand-alone",dLen:"narrow",matchIndex:1,key:"weekday",value:"narrow",regExp:nt},h:{token:"time",timePart:"hour",start1:0,end1:11,start2:1,end2:12,key:"hour",value:"numeric",regExp:"(\\d\\d?)"},hh:{token:"time",timePart:"hour",start1:0,end1:11,start2:1,end2:12,key:"hour",value:"2-digit",regExp:"(\\d\\d?)"},K:{token:"time",timePart:"hour",start1:0,end1:11,start2:0,end2:11,key:"hour",value:"numeric",regExp:"(\\d\\d?)"},KK:{token:"time",timePart:"hour",start1:0,end1:11,start2:0,end2:11,key:"hour",value:"2-digit",regExp:"(\\d\\d?)"},H:{token:"time",timePart:"hour",start1:0,end1:23,start2:0,end2:23,key:"hour",value:"numeric",regExp:"(\\d\\d?)"},HH:{token:"time",timePart:"hour",start1:0,end1:23,start2:0,end2:23,key:"hour",value:"2-digit",regExp:"(\\d\\d?)"},k:{token:"time",timePart:"hour",start1:0,end1:23,start2:1,end2:24,key:"hour",value:"numeric",regExp:"(\\d\\d?)"},kk:{token:"time",timePart:"hour",start1:0,end1:23,start2:1,end2:24,key:"hour",value:"2-digit",regExp:"(\\d\\d?)"},m:{token:"time",timePart:"minute",start1:0,end1:59,start2:0,end2:59,key:"minute",value:"numeric",regExp:"(\\d\\d?)"},mm:{token:"time",timePart:"minute",start1:0,end1:59,start2:0,end2:59,key:"minute",value:"2-digit",regExp:"(\\d\\d?)"},s:{token:"time",timePart:"second",start1:0,end1:59,start2:0,end2:59,key:"second",value:"numeric",regExp:"(\\d\\d?)"},ss:{token:"time",timePart:"second",start1:0,end1:59,start2:0,end2:59,key:"second",value:"2-digit",regExp:"(\\d\\d?)"},S:{token:"time",timePart:"millisec",start1:0,end1:999,start2:0,end2:999,key:"millisecond",value:"numeric",regExp:"(\\d{1,3})"},SS:{token:"time",timePart:"millisec",start1:0,end1:999,start2:0,end2:999,key:"millisecond",value:"numeric",regExp:"(\\d{1,3})"},SSS:{token:"time",timePart:"millisec",start1:0,end1:999,start2:0,end2:999,key:"millisecond",value:"numeric",regExp:"(\\d{1,3})"},d:{token:"dayOfMonth",key:"day",value:"numeric",getPartIdx:2,regExp:"(\\d\\d?)"},dd:{token:"dayOfMonth",key:"day",value:"2-digit",getPartIdx:2,regExp:"(\\d\\d?)"},M:{token:"monthIndex",key:"month",value:"numeric",getPartIdx:1,regExp:"(\\d\\d?)"},MM:{token:"monthIndex",key:"month",value:"2-digit",getPartIdx:1,regExp:"(\\d\\d?)"},L:{token:"monthIndex",key:"month",value:"numeric",getPartIdx:1,regExp:"(\\d\\d?)"},LL:{token:"monthIndex",key:"month",value:"2-digit",getPartIdx:1,regExp:"(\\d\\d?)"},y:{token:"year",key:"year",value:"numeric",regExp:"(\\d{1,4})"},yy:{token:"year",key:"year",value:"2-digit",regExp:"(\\d\\d?)"},yyyy:{token:"year",key:"year",value:"numeric",regExp:"(\\d{1,4})"},a:{token:"ampm",key:"hour12",value:!0,regExp:"(\\D*)"},z:{token:"tzAbbrev",regExp:"(.+?)"},v:{token:"tzAbbrev",key:"timeZoneName",value:"short",regExp:"(.+?)"},zz:{token:"tzAbbrev",regExp:"(.+?)"},zzz:{token:"tzAbbrev",regExp:"(.+?)"},zzzz:{token:"tzFull",regExp:"(.+?)"},Z:{token:"tzhm",regExp:"([+-]?\\d{1,4})"},ZZ:{token:"tzhm",regExp:"([+-]?\\d{1,4})"},ZZZ:{token:"tzhm",regExp:"([+-]?\\d{1,4})"},X:{token:"tzh",regExp:"([+-]?\\d{1,2})"},XX:{token:"tzhm",key:"XX",regExp:"([+-]?\\d{1,4})"},XXX:{token:"tzhsepm",regExp:"([+-]?\\d{1,2}:\\d{1,2})"},VV:{token:"tzid",regExp:"(.+?)"},G:{token:"era",key:"era",value:"short",regExp:nt},GG:{token:"era",key:"era",value:"short",regExp:nt},GGG:{token:"era",key:"era",value:"short",regExp:nt},GGGG:{token:"era",key:"era",value:"long",regExp:nt},GGGGG:{token:"era",key:"era",value:"narrow",regExp:nt},"/":{token:"slash",regExp:"(\\/)"}};return g=function(e){var t=e["two-digit-year-start"];return(void 0===t||isNaN(t))&&(t=1950),t=parseInt(t,10)},f=function(t){var r=t._ojLocale_,a=e.OraI18nUtils.getBCP47Region(r);return"h"===t.supplemental.prefferedHours[a]},y=function(e){return e%400==0||e%100!=0&&e%4==0},I=function(e,t){switch(t){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return y(e)?29:28;default:return 30}},h=function(t,r,a){var n,i,o,s=e.OraI18nUtils.getLocaleElementsMainNode(r),l=e.OraI18nUtils.getGetOption(t,a),d=l("formatType","string",["date","time","datetime"],"date"),u=l("dateFormat","string",["short","medium","long","full"],"short"),m=l("timeFormat","string",["short","medium","long","full"],"short"),c=s.dates.calendars.gregorian,v=c.dateFormats,g=c.timeFormats;switch(u){case"full":n=v.full;break;case"long":n=v.long;break;case"medium":n=v.medium;break;case"short":n=v.short}switch(m){case"full":i=g.full;break;case"long":i=g.long;break;case"medium":i=g.medium;break;case"short":i=g.short}return void 0===n||"datetime"!==d&&"date"!==d||(o=n),void 0===i||"datetime"!==d&&"time"!==d||(o=o?o+" "+i:i),o},r=function(e,t){for(var r=0,a=!1,n=0,i=e.length;nu&&(u=g,m=v)}}return void 0!==m?m.pattern:null},O=function(t,r,a){var n="",i="",o={},s={},l=e.OraI18nUtils.getGetOption(t,a),d=l("era","string",["narrow","short","long"]);n+=M(o,"era",d,{narrow:"GGGGG",short:"GGG",long:"GGGG"}),d=l("year","string",["2-digit","numeric"]),n+=M(o,"year",d,{"2-digit":"yy",numeric:"y"}),d=l("month","string",["2-digit","numeric","narrow","short","long"]),n+=M(o,"month",d,{"2-digit":"MM",numeric:"M",narrow:"MMMMM",short:"MMM",long:"MMMM"}),d=l("weekday","string",["narrow","short","long"]),n+=M(o,"weekday",d,{narrow:"EEEEE",short:"E",long:"EEEE"}),d=l("day","string",["2-digit","numeric"]),n+=M(o,"day",d,{"2-digit":"dd",numeric:"d"});var u=l("hour12","boolean",[!0,!1]);return void 0===u&&(u=f(r)),d=l("hour","string",["2-digit","numeric"]),i+=M(s,"hour",d,!0===u?{"2-digit":"hh",numeric:"h"}:{"2-digit":"HH",numeric:"H"}),d=l("minute","string",["2-digit","numeric"]),i+=M(s,"minute",d,{"2-digit":"mm",numeric:"m"}),d=l("second","string",["2-digit","numeric"]),i+=M(s,"second",d,{"2-digit":"ss",numeric:"s"}),d=l("timeZoneName","string",["short","long"]),[n,i+=M(s,"timeZoneName",d,{short:"v",long:"v"}),o,s]},M=function(e,t,r,a){return void 0!==r?(e[t]=r,a[r]):""},T=function(t,r,a){var n=t,i=e.OraI18nUtils.getGetOption(r,a),o=i("year","string",["2-digit","numeric"]),s={"2-digit":"yy",numeric:"yyyy"};if(void 0!==o&&(n=n.replace(/y{1,4}/,s[o])),void 0!==(o=i("month","string",["2-digit","numeric","narrow","short","long"]))){void 0!==(s={"2-digit":"MM",numeric:"M",narrow:"MMMMM",short:"MMM",long:"MMMM"})[o]&&s[o].length>2?n=(n=n.replace(/M{3,5}/,s[o])).replace(/L{3,5}/,{"2-digit":"LL",numeric:"L",narrow:"LLLLL",short:"LLL",long:"LLLL"}[o]):"2-digit"===o&&(Ne.lastIndex=0,Ne.test(t)&&(n=n.replace("M","MM")),ze.test(t)&&(n=n.replace("L","LL")))}if(void 0!==(o=i("weekday","string",["narrow","short","long"]))){n=(n=n.replace(/E{1,5}/,{narrow:"EEEEE",short:"EEE",long:"EEEE"}[o])).replace(/c{1,5}/,{narrow:"ccccc",short:"ccc",long:"cccc"}[o])}if(void 0!==(o=i("day","string",["2-digit","numeric"]))&&"2-digit"===o){Pe.lastIndex=0,Ae.lastIndex=0;var l=Ae.test(t);1==Pe.test(t)&&!1===l&&(n=n.replace("d","dd"))}return n},k=function(t,r,a){var n=t;if("2-digit"===e.OraI18nUtils.getGetOption(r,a)("hour","string",["2-digit","numeric"])){Ge.lastIndex=0,Ve.lastIndex=0;var i=t.replace(Ve,""),o=Ge.exec(i);if(null!==o){Re.lastIndex=0;var s=Re.exec(o[0]),l=s[0]+s[0];n=t.replace(s[0],l)}}return n},se=function(e,t,r){var a,n,i=0;for(a in t)i++;if(i>1)return null;for(a=e.length;a>0;a--)if(void 0!==(n=r[e.substr(0,a)]))return n;return e},function(t){var r="yyyy-MM-ddTHH:mm:ss";switch(e.OraI18nUtils.getGetOption(t,"OraDateTimeConverter.format")("isoStrFormat","string",[Qe,tt,"invariant",et,"auto"],"auto")){case Qe:t.timeZone="Etc/GMT+0",r+="'Z'";break;case tt:r+="XXX"}return r},ne=function(t,r){var a="symbols-numberSystem-"+e.OraI18nUtils.getNumberingSystemKey(t,r);return t.numbers[a].decimal},i=function(t,r,a,n){function i(e){if(void 0!==u){var r=ne(m,a);r=void 0===s&&void 0===l&&void 0===d?"S":"ss"+r+"SSS",e=e.replace("ss",r),void 0===d&&(t.second=void 0)}var n=v("timeZoneName","string",["short","long"]);return void 0!==n&&(e=e.replace(/v/,{short:"z",long:"zzzz"}[n])),e}var o,s,l,d,u,m=e.OraI18nUtils.getLocaleElementsMainNode(r),c=e.OraI18nUtils.getLocaleElementsMainNodeKey(r),v=e.OraI18nUtils.getGetOption(t,n),g=v("formatMatcher","string",["basic","munger"],"munger"),p=0;for(p in t)p++;0===p&&(t={year:"numeric",month:"numeric",day:"numeric"}),u=v("millisecond","string",["numeric","2-digit"]),d=v("second","string",["numeric","2-digit"]),void 0!==u&&(s=v("hour","string",["numeric","2-digit"]),l=v("minute","string",["numeric","2-digit"]),t.second="2-digit");var y=O(t,r,n);if(void 0!==_e[c]){var I=_e[c].dates.calendars.gregorian.dateTimeFormats[y[0]+y[1]];if(void 0!==I)return I=i(I)}if(""===y[0]&&""===y[1])return h(t,r,n);var M=m.dates.calendars.gregorian.dateTimeFormats.availableFormats,E=M[y[0]],b=v("hour12","boolean",[!0,!1]);void 0===b&&(b=f(r)),void 0===E&&""!==y[0]&&(null===(E=se(y[0],y[2],M))&&(E=D(y[2],r,0,b)),null!==E?"basic"!==g&&(E=T(E,t,n)):E=y[0]);var U=M[y[1]];return void 0===U&&""!==y[1]&&(null===(U=se(y[1],y[3],M))&&(U=D(y[3],r,0,b)),null!==U?"basic"!==g&&(U=k(U,t,n)):U=y[1]),o=E||"",void 0!==U&&(""!==o?o+=" "+U:o=U),void 0===_e[c]&&(_e[c]={},_e[c].dates={},_e[c].dates.calendars={},_e[c].dates.calendars.gregorian={},_e[c].dates.calendars.gregorian.dateTimeFormats={}),_e[c].dates.calendars.gregorian.dateTimeFormats[y[0]+y[1]]=o,o=i(o)},Ie=function(e){var t=e.split(" "),r=t[0].split("-"),a=new Date(r[0],r[1]-1,r[2]);return t.length>1&&(r=t[1].split(":"),a.setHours(r[0]),a.setMinutes(r[1])),a.getTime()},ye=function(e,t,r){var a=new Date(e[0],e[1]-1,e[2],e[3],e[4],e[5]);a=a.getTime();var n=t.split("/"),i=n[0],o=n[1],s=r[i];if(void 0===s)return null;if(void 0===(s=s[o]))return null;var l,d,u,m,c,v,g=s.length;for(l=0;l=(d=Ie(m)))return v;if(void 0!==m&&void 0!==c&&(d=Ie(m),u=Ie(c),a>=d&&a1?e.OraI18nUtils.padZeros(i,n):i)}function I(t,r,n,i,o){var s;switch(i.timePart){case"hour":s=11===i.end1?r[3]%12:r[3],"h"===o||"hh"===o?0===s&&(s=12):"k"!==o&&"kk"!==o||0===s&&(s=24);break;case"minute":s=r[4];break;case"second":s=void 0===a.second&&void 0!==a.millisecond?0:r[5];break;case"millisec":s=r[6]}t.push(n>1?e.OraI18nUtils.padZeros(s,n):s)}function O(r,a,i){var o,s,l,d=a.timeZone,u=v("dst","boolean",[!0,!1],!1),m=!i;if(void 0!==d)s=Te(d,t),l=ke(s,r,u,m,!0),o=-s.ofset(l);else if(n.format!==et)switch(n.format){case tt:o=n.timeZone.split(":");var c=parseInt(o[0],10),g=parseInt(o[1],10);o=60*c+(e.OraI18nUtils.startsWith(n.timeZone,"-")?-g:g);break;case Qe:default:o=0}return o}var T=a.timeZone;for(n.format!==et&&void 0!==T&&ce(n,a,t);;){var k=Ke.lastIndex,D=Ke.exec(l),M=l.slice(k,D?D.index:l.length);if(f+=r(M,s),!D)break;if(f%2)s.push(D[0]);else{var E=D[0],b=E.length,U=it[E];switch(U.token){case"days":g=p[U.token][U.style][U.dLen],s.push(g[h(d,3)]);break;case"months":g=p[U.token][U.style][U.mLen],s.push(g[h(d,1)]);break;case"dayOfMonth":case"monthIndex":s.push(y(s,d,U.getPartIdx,b));break;case"year":g=d[0],2===b&&(g%=100),s.push(e.OraI18nUtils.padZeros(g,b));break;case"time":I(s,d,b,U,E);break;case"ampm":g=d[3]<12?p.dayPeriods.format.wide.am:p.dayPeriods.format.wide.pm,s.push(g);break;case"tzhm":0===(g=O(d,a,m))?"XX"===U.key?s.push("Z"):s.push("+0000"):s.push((g<=0?"-":"+")+e.OraI18nUtils.padZeros(Math.floor(Math.abs(g/60)),2)+e.OraI18nUtils.padZeros(Math.floor(Math.abs(g%60)),2));break;case"tzhsepm":0===(g=O(d,a,m))?s.push("Z"):s.push((g<=0?"-":"+")+e.OraI18nUtils.padZeros(Math.floor(Math.abs(g/60)),2)+":"+e.OraI18nUtils.padZeros(Math.floor(Math.abs(g%60)),2));break;case"tzh":0===(g=O(d,a,m))?s.push("Z"):s.push((g<=0?"-":"+")+e.OraI18nUtils.padZeros(Math.floor(Math.abs(g/60)),2));break;case"tzid":g=void 0!==T?T:n.format===Qe?rt:"",s.push(g);break;case"tzAbbrev":g=Oe(t,d,a,0,m),s.push(g);break;case"tzFull":g=Oe(t,d,a,1,m),s.push(g);break;case"era":g=p.eras.eraAbbr,s.push(g[1]);break;case"slash":s.push("/");break;default:u(l,a,E)}}}return s.join("")},U=function(e,t){return e.getFullYear()===t.getFullYear()},w=function(e,t){return t.getFullYear()-e.getFullYear()==1},x=function(e,t){return w(t,e)},S=function(e,t){return U(e,t)&&e.getMonth()===t.getMonth()},C=function(e,t){return U(e,t)?t.getMonth()-e.getMonth()==1:!!w(e,t)&&(11===e.getMonth()&&0===t.getMonth())},_=function(e,t){return C(t,e)},E=function(e,t){var r=e.getDate(),a=t.getDate();return C(e,t)&&(a+=I(e.getFullYear,e.getMonth())),a-r},b=function(t,r){var a=t._ojLocale_,n=e.OraI18nUtils.getBCP47Region(a),i=t.supplemental.weekData.firstDay,o=i[n];void 0===o&&(o=i["001"]);var s=r-o;return s<0&&(s+=7),s},L=function(e,t,r){if(t>r){var a=t;t=r,r=a}if(!S(t,r)&&!C(t,r))return!1;var n=E(t,r)+b(e,t.getDay());return n>=0&&n<=6},Z=function(e,t,r){if(!S(t,r)&&!C(t,r))return!1;var a=E(t,r)+b(e,t.getDay());return a>=7&&a<=13},F=function(e,t,r){return Z(e,r,t)},N=function(e,t){return U(e,t)&&S(e,t)&&e.getDate()===t.getDate()},z=function(e,t){return!(!S(e,t)&&!C(e,t))&&1===E(e,t)},P=function(e,t){return z(t,e)},De=function(t,r,a){var n=a.timeZone;if(e.OraI18nUtils.getISOStrFormatInfo(t).format===et&&void 0===n)return t;var i={isoStrFormat:"zulu"};void 0!==n&&(i.timeZone=n,i.dst=!0);var o=l(t,r,i,"en-US");return i={timeZone:e.OraI18nUtils.getLocalTimeZoneOffset(),isoStrFormat:"local"},l(o.value,r,i,"en-US").value},Me=function(t,r,a){var n=e.OraI18nUtils._IsoStrParts(t),i=e.OraI18nUtils._IsoStrParts(r);return a?(n=Date.UTC(n[0],n[1]-1,n[2],0,0,0,0),i=Date.UTC(i[0],i[1]-1,i[2],0,0,0,0)):(n=Date.UTC(n[0],n[1]-1,n[2],n[3],n[4],n[5],n[6]),i=Date.UTC(i[0],i[1]-1,i[2],i[3],i[4],i[5],i[6])),n-i},Ee=function(e,t){return e.replace(/\{(\d+)\}/g,function(){return t[arguments[1]]})},be=function(t,r,a,n){var i,o,l,d,u=e.OraI18nUtils.getLocaleElementsMainNode(a),m=u.dates.calendars.gregorian.dateTimeFormats.long,c=u.dates.calendars.gregorian.days.format.wide,v=u.dates.fields,g=e.OraI18nUtils.isoToLocalDate(r),f=e.OraI18nUtils.isoToLocalDate(t),p=e.OraI18nUtils.getISOStrFormatInfo(r);if(N(f,g))i=v.day["relative-type-0"];else if(z(f,g))i=v.day["relative-type-1"];else if(P(f,g))i=v.day["relative-type--1"];else{l=g.getDay(),d=We[l];var h=Me(r,t,!0);if((h/=864e5)<-1&&h>-7)i=v[d]["relative-type--1"];else{if(!(h>1&&h<7))return s(a,{year:"numeric",month:"numeric",day:"numeric"},p,"en-US");i=c[d]}}return n?i:(o=s(a,{hour:"numeric",minute:"numeric"},p,"en-US"),m=m.replace(/'/g,""),m=Ee(m,[o,i]))},Ue=function(t,r,a,n){var i=e.OraI18nUtils.getLocaleElementsMainNode(n).dates.fields,o=e.OraI18nUtils.getGetOption(a,"OraDateTimeConverter.formatRelative")("dateField","string",["day","week","month","year","hour","minute","second"]),s=e.OraI18nUtils.isoToLocalDate(t),l=e.OraI18nUtils.isoToLocalDate(r);switch(o){case"day":return N(s,l)?i.day["relative-type-0"]:z(s,l)?i.day["relative-type-1"]:P(s,l)?i.day["relative-type--1"]:we(t,r,n,"day");case"week":return L(n,s,l)?i.week["relative-type-0"]:Z(n,s,l)?i.week["relative-type-1"]:F(n,s,l)?i.week["relative-type--1"]:we(t,r,n,"week");case"month":return S(s,l)?i.month["relative-type-0"]:C(s,l)?i.month["relative-type-1"]:_(s,l)?i.month["relative-type--1"]:we(t,r,n,"month");case"year":return U(s,l)?i.year["relative-type-0"]:w(s,l)?i.year["relative-type-1"]:x(s,l)?i.year["relative-type--1"]:we(t,r,n,"year");case"hour":return we(t,r,n,"hour");case"minute":return we(t,r,n,"minute");case"second":return we(t,r,n,"second")}return null},Ce=function(e){return 4800*e/146097},Se=function(e){var t=Ce(e/864e5),r=t/12;return{year:Math.round(r),month:Math.round(t),week:Math.round(e/6048e5),day:Math.round(e/864e5),hour:Math.round(e/36e5),minute:Math.round(e/6e4),second:Math.round(e/1e3),millisecond:e}},xe=function(e){return e.split("-")[0]},we=function(t,r,a,n){var i=e.OraI18nUtils.getLocaleElementsMainNodeKey(a),o=e.OraI18nUtils.getLocaleElementsMainNode(a),s=xe(i),l=a.supplemental.plurals,d=o.dates.fields,u=Me(r,t,!1),m=Math.abs(u),c=Se(m);if(null===n&&(n=(c.seconda){var s=new RangeError(n+" is out of range. Enter a value between "+i+" and "+o+" for "+e),l={errorCode:"datetimeOutOfRange",parameterMap:{value:n,minValue:i,maxValue:o,propertyName:e}};throw s.errorInfo=l,s}},V=function(e,t){for(var r=0;r2||y>31)&&(s=y,p=!0,u=c-1)}for(p||(u=V(v,"y"),s=o[V(v,"y")+1]),c=0;c<3;c++)if(c!==u&&o[c+1]>12){d=o[c+1],h=!0,m=c;break}if(h){for(c=0;c<3;c++)if(c!==m&&c!==u){l=o[c+1];break}void 0===l&&(l=o[V(v,"M")+1])}else u===V(v,"d")?(d=o[V(v,"y")+1],l=o[V(v,"M")+1]):u===V(v,"M")?(d=o[V(v,"d")+1],l=o[V(v,"y")+1]):(d=o[V(v,"d")+1],l=o[V(v,"M")+1]);var O=I(s,l-=1);h&&f!==m&&l>12&&te("month",d,0,11,d,1,12),te("month",l,0,11,l+1,1,12),te("day",d,1,O,d,1,O);var T=g(a);s=G(T,parseInt(s,10)),te("year",s,0,9999,s,0,9999);var k=new Date(s,l,d),D=he(t,n);if(null!==D){var M=K(n,D,0);k.getDay()!==M&&le(D,k.getDate())}var E={value:k,offset:"",warning:"lenient parsing was used"};if(i){var b=t.substr(Fe.lastIndex);0===b.length?E.value.setHours(0,0,0,0):H(E.value,b,r,n,2)}return E.value=e.OraI18nUtils.dateToLocalIso(E.value),E},R=function(t,r,a,n,i){var o=t;t=e.OraI18nUtils.toUpper(t);var s,l,d,u,m=e.OraI18nUtils.getLocaleElementsMainNode(n),c=m.dates.calendars.gregorian.months.format,v=m.dates.calendars.gregorian.months["stand-alone"],f=[c.wide,c.abbreviated,v.wide,v.abbreviated],p=!1;for(l in f){for(d in s=[],f[l])u=e.OraI18nUtils.toUpper(f[l][d]),s.push({idx:d,name:u});for(d in s.sort(function(e,t){return t.idx-e.idx}),s)if(u=s[d].name,-1!==t.indexOf(u)){p=!0,t=t.replace(u,"");break}if(p)break}if(!p)return j(o,r,a,n,i);var h=Y(n,u,2);te("month",h,0,11,h,1,12);var y=he(o,n),O=new RegExp(y+"\\W","i");null!==y&&(t=t.replace(O,"")),Ze.lastIndex=0;var T=Ze.exec(t);null===T&&oe(o,r,i?2:0);var k,D,M,E=[{y:r.indexOf("y")},{d:r.indexOf("d")}];E.sort(function(e,t){for(var r in e)break;for(var a in t)break;return e[r]-t[a]});var b=!1;for(l=1;l<=2;l++){var U=T[l];(U.length>2||U>31)&&(k=U,b=!0,M=l-1)}b||(M=V(E,"y"),k=T[V(E,"y")+1]),D=M===V(E,"d")?T[V(E,"y")+1]:T[V(E,"d")+1];var w=g(a);k=G(w,parseInt(k,10)),te("year",k,0,9999,k,0,9999);var x=new Date(k,h,D);if(null!==y){var S=K(n,y,0);x.getDay()!==S&&le(y,x.getDate())}var C=I(k,h);te("day",D,1,C,D,1,C);var _={value:x,offset:"",warning:"lenient parsing was used"};if(i){var L=t.substr(Ze.lastIndex);0===L.length?_.value.setHours(0,0,0,0):H(_.value,L,r,n,2)}return _.value=e.OraI18nUtils.dateToLocalIso(_.value),_},A=function(t,r,a,n){switch(c(a,"OraDateTimeConverter.parse")){case 0:return R(t,r,a,n,!1);case 1:var i=new Date;return H(i,t,r,n,1),{value:e.OraI18nUtils.dateToLocalIso(i),offset:"",warning:"lenient parsing was used"};case 2:return R(t,r,a,n,!0)}return null},pe=function(t,r,a,n,i,o,s,l,d,u,m){var c,v,g,f=e.OraI18nUtils.getLocaleElementsMainNode(t).dates.calendars.gregorian[r][i];return c="months"===r?Y(t,a,o):K(t,a,o),v=f[n][d],g=f[n][u],te(m,c,s,l,a,v,g),c},fe=function(e,t,r,a){t[r.timePart]=e,"h"===a||"hh"===a?12===e&&(t[r.timePart]=0):"k"!==a&&"kk"!==a||24===e&&(t[r.timePart]=0),te(r.timePart,t[r.timePart],r.start1,r.end1,e,r.start2,r.end2)},o=function(t,r,a,n){var i=e.OraI18nUtils.getLocaleElementsMainNode(n),o=i.dates.calendars.gregorian.eras.eraAbbr[1],s=e.OraI18nUtils.trimNumber(o);t=t.replace(o,s);var l=e.OraI18nUtils.getGetOption(a,"OraDateTimeConverter.parse")("lenientParse","string",["none","full"],"full"),d=c(a,"OraDateTimeConverter.parse"),u=q(r,a),m=new RegExp(u.regExp).exec(t);if(null===m){if("full"===l)return A(t,r,a,n);oe(t,r,d)}for(var v,f=u.groups,p=null,h=null,y=null,O=null,T="",k=null,D=!1,M={hour:0,minute:0,second:0,millisec:0},E=i.dates.calendars.gregorian.dayPeriods.format.wide.pm,b=g(a),U=0,w=f.length;U31&&"full"===l)return A(t,r,a,n);break;case"monthIndex":if((h=C-1)>11&&"full"===l)return A(t,r,a,n);break;case"year":p=G(b,C),te("year",p,0,9999,p,0,9999);break;case"ampm":D=-1!==e.OraI18nUtils.toUpper(x).indexOf(e.OraI18nUtils.toUpper(E));break;case"tzhm":T=x.substr(-2),T=x.substr(0,3)+":"+T;break;case"tzhsepm":T=x;break;case"tzh":T=x+":00";break;case"tzid":k=x}}}var L=new Date;null===p&&(p=L.getFullYear()),null===h&&null===y?(h=L.getMonth(),y=L.getDate()):null===y&&(y=1),te("month",h,0,11,h+1,1,12);var Z=I(p,h);te("day",y,1,Z,y,1,Z),L.setFullYear(p,h,y),null!==O&&L.getDay()!==O&&le(v,L.getDate()),D&&M.hour<12&&(M.hour+=12);var F=[p,h+1,y,M.hour,M.minute,M.second,M.millisec],N=e.OraI18nUtils.partsToIsoString(F);if(null!==k){var z=Te(k,n),P=ke(z,F,!1,!0,!0);T=-z.ofset(P),T=e.OraI18nUtils.getTimeStringFromOffset("",T,!1,!0)}return""!==T&&(N+=T),{value:N}},m=function(e,t,a){for(var n,i=a.replace(He,"\\\\$1"),o=["^"],s=0,l=0,d={locale:e,numberingSystem:t,calendar:"gregorian"};null!==(n=Ke.exec(i));){var m=i.slice(l,n.index);if(l=Ke.lastIndex,!((s+=r(m,o))%2)){var c=n[0];"/"!==c&&"zzzz"!==c&&"zzz"!==c&&"zz"!==c&&"z"!==c&&(void 0!==it[c]?(void 0!==it[c].key&&(d[it[c].key]=it[c].value),"kk"===c||"HH"===c||"H"===c||"k"===c?d.hour12=!1:"KK"!==c&&"hh"!==c&&"h"!==c&&"K"!==c||(d.hour12=!0)):u(a,d,c))}}return d},p=function(e){var t=m("","",e),r=void 0!==t.year||void 0!==t.month||void 0!==t.weekday||void 0!==t.day,a=void 0!==t.hour||void 0!==t.minute||void 0!==t.second||void 0!==t.millisecond;return r&&a?2:a?1:0},v=function(e){var t=e.indexOf("T");return-1===t?0:t>0?2:1},c=function(t,r){if(void 0!==t.pattern)return p(t.pattern);var a=e.OraI18nUtils.getGetOption(t,r),n=void 0!==a("hour","string",["2-digit","numeric"])||void 0!==a("minute","string",["2-digit","numeric"])||void 0!==a("second","string",["2-digit","numeric"])||void 0!==a("millisecond","string",["numeric"]),i=void 0!==a("year","string",["2-digit","numeric"])||void 0!==a("month","string",["2-digit","numeric","narrow","short","long"])||void 0!==a("day","string",["2-digit","numeric"])||void 0!==a("weekday","string",["narrow","short","long"]);if(i&&n)return 2;if(n)return 1;if(i)return 0;var o=a("formatType","string",["date","time","datetime"],"date");return"datetime"===o?2:"time"===o?1:0},ve=function(e,t){var r=ke(e,t,!1,!0,!1),a=e.ofset(r),n=e.ofset(r+1);return Math.max(a,n)},ce=function(t,r,a){var n,i,o,s,l=t.isoStrParts,d=t.format,u=r.timeZone,m=(e.OraI18nUtils.getGetOption(r,"OraDateTimeConverter.parse"),Te(u,a));switch(n=Date.UTC(l[0],l[1]-1,l[2],l[3],l[4],l[5]),d){case tt:var c=t.timeZone;i=c.split(":");var v=parseInt(i[0],10),g=parseInt(i[1],10);i=60*v+(e.OraI18nUtils.startsWith(c,"-")?-g:g);break;case Qe:i=0}n-=6e4*((o=ve(m,l))+i),s=m.parse(n,!1,!0,!1),o=-m.ofset(s),o-=i;var f=new Date(Date.UTC(l[0],l[1]-1,l[2],l[3],l[4],l[5])),p=f.getUTCMinutes()+o;f.setUTCHours(f.getUTCHours()+(p/60<<0),p%60),l[0]=f.getUTCFullYear(),l[1]=f.getUTCMonth()+1,l[2]=f.getUTCDate(),l[3]=f.getUTCHours(),l[4]=f.getUTCMinutes(),l[5]=f.getUTCSeconds()},function(e){var t=2,r=e.dateTime.split("T");return""===r[0]?t=1:void 0===r[1]&&(t=0),t},me=function(t,r){var a,n="";switch(t){case 0:n=e.OraI18nUtils.padZeros(r[0],4)+"-"+e.OraI18nUtils.padZeros(r[1],2)+"-"+e.OraI18nUtils.padZeros(r[2],2);break;case 1:n="T"+e.OraI18nUtils.padZeros(r[3],2)+":"+e.OraI18nUtils.padZeros(r[4],2)+":"+e.OraI18nUtils.padZeros(r[5],2),(a=r[6])>0&&(n+="."+e.OraI18nUtils.trimRightZeros(e.OraI18nUtils.padZeros(a,3)));break;default:n=e.OraI18nUtils.padZeros(r[0],4)+"-"+e.OraI18nUtils.padZeros(r[1],2)+"-"+e.OraI18nUtils.padZeros(r[2],2)+"T"+e.OraI18nUtils.padZeros(r[3],2)+":"+e.OraI18nUtils.padZeros(r[4],2)+":"+e.OraI18nUtils.padZeros(r[5],2),(a=r[6])>0&&(n+="."+e.OraI18nUtils.trimRightZeros(e.OraI18nUtils.padZeros(a,3)))}return n},ue=function(t,r,a,n,i,o){var s=Te(t,i),l=ke(s,r,a,n,o),d=s.ofset(l);return e.OraI18nUtils.getTimeStringFromOffset("",d,!0,!0)},de=function(t,r,a,n){var i,o,s,l=e.OraI18nUtils.getGetOption(a,"OraDateTimeConverter.parse"),d=l("isoStrFormat","string",[Qe,tt,"invariant",et,"auto"],"auto"),u=l("dst","boolean",[!0,!1],!1),m=!0,c=r.isoStrParts,v=r.timeZone,g=a.timeZone,f=r.format,p=a.isoStrFormat,h=me(t,c);if(0===t||"local"===p)return h;switch(1===t&&(m=!1),d){case tt:void 0===g&&f===tt?h+=v:void 0===g&&f===et?h+="":void 0===g&&f===Qe?h+="+00:00":void 0!==g&&(h+=s=ue(g,c,u,m,n,!0));break;case Qe:var y=0;if(void 0===g){if(f===tt){s=v.split(":");var I=parseInt(s[0],10),O=parseInt(s[1],10);y=-(y=60*I+(e.OraI18nUtils.startsWith(s[0],"-")?-O:O))}}else i=Te(g,n),o=ke(i,c,u,m,!0),y=s=i.ofset(o);if(0!==y){var T=new Date(Date.UTC(c[0],c[1]-1,c[2],c[3],c[4],c[5],c[6]));y=T.getUTCMinutes()+y,T.setUTCHours(T.getUTCHours()+(y/60<<0),y%60),c[0]=T.getUTCFullYear(),c[1]=T.getUTCMonth()+1,c[2]=T.getUTCDate(),c[3]=T.getUTCHours(),c[4]=T.getUTCMinutes(),c[5]=T.getUTCSeconds(),h=me(t,c)}h+="Z";break;case"auto":void 0!==g?h+=s=ue(g,c,u,m,n,!0):(s=v)&&(h+=s)}return h},l=function(t,r,a,n){var s,l,d=e.OraI18nUtils.getNumberingExtension(n);if(void 0===e.OraI18nUtils.numeringSystems[d]&&(d="latn"),"latn"!==d){var u,m=[];for(u=0;u="0"&&l[u]<="9"?m.push(e.OraI18nUtils.numeringSystems[d][l[u]]):m.push(l[u]);return m.join("")}return l},formatRelative:function(e,t,r){return d(e,t,r)},parse:function(e,t,r,a){return l(e,t,r,a)},resolvedOptions:function(e,t,r){return X(e,t,r)},calculateWeek:function(t){var r,a=e.OraI18nUtils.isoToLocalDate(t),n=new Date(a.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),r=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((r-n)/864e5)/7)+1},getAvailableTimeZones:function(e){return ge(e)},compareISODates:function(t,r,a){var n=re(t,r),i=l(t,a,n,"en-US"),o=l(r,a,n,"en-US"),s=i.value.replace("Z",""),d=o.value.replace("Z",""),u=e.OraI18nUtils._IsoStrParts(s);u=Date.UTC(u[0],u[1]-1,u[2],u[3],u[4],u[5],u[6]);var m=e.OraI18nUtils._IsoStrParts(d);return u-(m=Date.UTC(m[0],m[1]-1,m[2],m[3],m[4],m[5],m[6]))},isHour12:function(e){return f(e)},getTimePositioning:function(t,r,a){var n=X(t,r,a),i=n.pattern||n.patternFromOptions;i=(i=i.replace(/\'[^']*\'/g,"").replace(/[^hHkKma]*/g,"")).replace(/(h|H|k|K)+/,"h").replace(/m+/,"m");var o=e.OraI18nUtils.getLocaleElementsMainNodeKey(t),s=xe(o),l="ar"===s||"he"===s,d={},u=0,m=i.length;for(u=0;u=0?n:-n)y)return;a=s(a,1),r=e.replace("/etc//i","").toUpperCase()+"|"+a+"|0|"}void 0!==r&&this._set(o(e,r))}return l=function(e,t){for(var r,a=".",n="";t>0;)t-=1,e*=60,r=Math.floor(e+1e-6),a+=I[r],e-=r,r&&(n+=a,a="");return n},s=function(e,t){for(var r="",a=Math.abs(e),n=Math.floor(a),i=l(a-n,Math.min(~~t,10));n>0;)r=I[n%60]+r,n=Math.floor(n/60);return e<0&&(r="-"+r),r&&i?r+i:(i||"-"!==r)&&(r||i)||"0"},t=function(e){return e>96?e-87:e>64?e-29:e-48},r=function(e){var r=0,a=e.split("."),n=a[0],i=a[1]||"",o=1,s=0,l=1;for(45===e.charCodeAt(0)&&(r=1,l=-1);r=s&&ei){if(!0!==a)return o+1;v()}if(e>=l&&e=0&&e